$(function () {
	$("#content").on('click', function (e) {
		//当前点击的目标
		var obj = $(e.target);
		var name = obj.attr('name')
		switch(name){
			case "role_details":
				role_details(obj);
			break;
			case "tabpage":
				tabpage(obj);
			break;

		}
	})
})

/*
*	角色详情
*
*/
function role_details(obj) {
	var role_keyId = obj.attr("data-keyid");
	$.ajax({
		url: "/system/roledetails/",
		type: "get",
		data: {
			role_keyid: role_keyId
		},
		success:function (data) {
			$("#role_content").html(data)
		}
	})


}

/*
*	角色权限选项卡
*
*/
function tabpage(obj) {
	var isActive = obj.parent().hasClass('active');
	if (isActive) {
		return;
	}
	obj.parent().siblings().removeClass('active');
	obj.parent().addClass('active');
	var type = obj.attr("data-type")
	switch(type){
		case "department_set":
		
		break;
		case "personal_center":
		
		break;
	}
}